<?php
if(file_exists("tmp"))
{
    session_save_path("tmp");
}
else if (file_exists("../tmp"))
{
    session_save_path("../tmp");
}
else
{
     session_save_path("../../tmp");
}

define('CnstSmartyPath', 'smarty/Smarty.class.php');

if(file_exists("../".CnstSmartyPath))
{
    require_once("../".CnstSmartyPath);
}
else if(file_exists("../../".CnstSmartyPath))
{
    require_once("../../".CnstSmartyPath);
}
else
{
    require_once("../../../".CnstSmartyPath);
}

session_cache_expire(42000);
session_start();
error_reporting(E_ALL ^E_NOTICE);
$smarty = new Smarty();

$AvalibleLanguages = array('pl','de','nl', 'en');
if(!isset($_COOKIE['CurrantLanguage'])) $_COOKIE['CurrantLanguage'] = $AvalibleLanguages[0];
unset($AvalibleLanguages[array_search($_COOKIE['CurrantLanguage'], $AvalibleLanguages)]);
include_once "resources/$_COOKIE[CurrantLanguage].php";
$config = array(
    'baseUrl'               => 'http://127.0.0.1/nzs'
    ,'AvalibleLanguages'    => $AvalibleLanguages
);


$smarty->assign('config', $config);
?>